package by.qizer.names;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class DummyDataAdapter extends BaseAdapter {

	private Context mContext;

	public DummyDataAdapter(Context context) {
		mContext = context;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		String item = Constants.DATA[position];

		LayoutInflater inflater = LayoutInflater.from(mContext);
		View view = inflater.inflate(R.layout.dummy_layout_item, null);
		TextView number = (TextView) view.findViewById(R.id.number);
		number.setText((position + 1) + ". ");

		TextView data = (TextView) view.findViewById(R.id.data);
		data.setText(item);

		Log.i(number.getText().toString(), data.getText().toString());
		return view;
	}

	@Override
	public int getCount() {
		return Constants.DATA.length;
	}

	@Override
	public Object getItem(int position) {
		return Constants.DATA[position];
	}

	@Override
	public long getItemId(int position) {
		return position;
	}
}
